<?php
/**
 * Created by PhpStorm.
 * User: ChengChaogui
 * Date: 2016/11/30
 * Time: 9:24
 */

$page = 1;
$total = $pagerSet->total();
$curPage = $pagerSet->currentPage();
$pageSize = 20;

if ($total % $pageSize == 0) {
    $page = $total / $pageSize;
} else {
    $page = ceil($total / $pageSize);
}

?>


<div class="col-sm-4">
    <div class="dataTables_info" id="example1_info" role="status" aria-live="polite">
        <span>共查询到 {{$total}} 条数据</span>
    </div>
</div>

<div class="col-sm-4">
    <div class="dataTables_info" id="example1_info" role="status" aria-live="polite">
        @if(isset($footStat)&&!empty($footStat))
            @foreach($footStat as $key=>$val)
                <span>{{$key}}：￥<strong class="text text-danger">{{$val}}</strong></span>&nbsp;&nbsp;
            @endforeach
        @endif
    </div>
</div>

<div class="col-sm-4">
    <div class="dataTables_paginate paging_simple_numbers">
        <ul class="pagination pull-right">
            @if($curPage<=1)
                <li class="paginate_button previous disabled"><a href="javascript:void(0);">上一页</a></li>
            @else
                <li class="paginate_button previous"><a href="javascript:setPage('{{$curPage -1}}');">上一页</a></li>
            @endif

            @for ($i = $curPage - 5; $i <= $curPage + 5; $i++)
                @if ($i < 1 || $i > $page)
                    @continue;
                @elseif($i == $curPage)
                    <li class="paginate_button active"><a href="javascript:void(0);">{{$i}}</a></li>
                @else
                    <li class="paginate_button"><a href="javascript:setPage('{{$i}}')">{{$i}}</a></li>
                @endif
            @endfor

            @if ($curPage >= $page)
                <li class="paginate_button next disabled"><a href="javascript:void(0);">下一页</a></li>
            @else
                <li class="paginate_button next"><a href="javascript:setPage('{{$curPage+1}}');">下一页</a></li>
            @endif

        </ul>
    </div>
</div>

@section('scripts')
    <script type="text/javascript">
        function setPage(page) {
            $('[name="page"]').val(page);
            document.forms[0].submit();
        }
    </script>
@endsection